package cn.fintecher.pangolin.service.manage.service;

import cn.fintecher.pangolin.entity.mysql.Color;
import cn.fintecher.pangolin.service.manage.repository.ColorRepository;
import org.apache.commons.collections4.IterableUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Auther: xiaqun
 * @Description:
 * @Date: 18:02 2019/8/16
 */

@Service("colorService")
@Transactional(rollbackFor = Exception.class)
public class ColorService {
    @Autowired
    private ColorRepository colorRepository;

    /**
     * 获取全部颜色
     */
    public List<Color> findAllColor() {
        Iterable<Color> iterable = colorRepository.findAll();
        return IterableUtils.toList(iterable);
    }
}
